package cn.elead.chaos.sso.server.exception;

import cn.elead.chaos.framework.exception.ApiException;
import cn.elead.chaos.framework.web.global.ErrorCode;
import cn.elead.chaos.framework.web.global.ErrorCodeEnum;

/**
 * 异常
 * @author Administrator
 *
 */
public class OauthApiException extends ApiException {

	private static final long serialVersionUID = 1L;

	/**
	 * 错误码
	 */
	private final ErrorCode errorCode;

	public OauthApiException(ErrorCodeEnum errorCodeEnum) {
		super(errorCodeEnum);
		this.errorCode = errorCodeEnum.convert();
	}

	public OauthApiException(ErrorCode errorCode) {
		super(errorCode);
		this.errorCode = errorCode;
	}

	public ErrorCode getErrorCode() {
		return errorCode;
	}
}
